<?php
/**
 * Parameters
 * @param	RunTimeWorkflowNode	$current_work_item
 */
  use_helper('Text');
  if(!isset($current_work_item)) $current_work_item = null;
?>
			<div id="wf_inbox_message_view">
				<div class="message">
                    <?php if(is_null($current_work_item)):?>
        				<p><i>Keine Nachricht ausgewählt.</i></p>
        			<?php else:?>
            			<h4><?php echo $current_work_item->getSubject()?></h4>
            			<?php echo simple_format_text($current_work_item->getMessage())?>
            			<?php if($current_work_item->hasActions()):?>
            			<?php $actions = $current_work_item->getActions();?>
            			<p>
            			<?php $first = true;?>
            			<?php foreach($actions as $key => $action):?>
            				<?php if($first === false):?> | <?php else:?><?php $first = false;?><?php endif;?>
            				<a href="<?php echo url_for($action->getRouteName(), $action->getRouteParameters());?>"><?php echo $action->getLabel();?></a>
            			<?php endforeach;?>
            			</p>
            			<?php endif;?>
        			<?php endif;?>
        		</div>
        		<div class="loading hidden">
        			<p><img src="<?php echo image_path('loading.gif');?>" /> Lade Nachricht</p>
        		</div>
			</div>